<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>  </title>
</head>
<body>
    <button onclick="show1()">计算函数运算结果</button>
</body>
<script>
    function show1(){
        var n1 = prompt("请输入第一个整数：");
        var n2 = prompt("请输入第二个整数：");
        var opt = prompt("请输入运算符：");
        var exp = n1 + opt + n2;
        var result = eval(exp);
        alert(exp + "=" + result);      
    }
</script>
</html>